//
//  ControllerDemoViewController.m
//  iPhoneSDKAD
//
//  Created by smu on 11-8-9.
//  Copyright 2011年 duk. All rights reserved.
//

#import "ControllerDemoViewController.h"


@implementation ControllerDemoViewController

- (id)init
{
    self = [super init];
    if (self != nil) {
        //演示一下如何分配对象，虽然我们并不需要这些对象
        helloWorld = [[NSString alloc] initWithString:@"Hello, World!"];
        woahDizzy = [[NSString alloc] initWithString:@"Woah,I'm Dizzy"];
    }
    return self;
}

- (void)loadView
{
    [super loadView];
    textView = [[UITextView alloc] initWithFrame:
                [[UIScreen mainScreen] applicationFrame]];
    textView.text = helloWorld;
    self.view = textView;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
    return YES;
}

- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
    textView.text = woahDizzy;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    //在此添加定制的代码，处理加载之后的工作
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    //在此处加入内存不足的代码
}

- (void)dealloc
{
    //这里是释放我们曾经分配过的对象的地方
    [helloWorld release];
    [woahDizzy release];
    [textView release];
    [super dealloc];
}

@end
